/**
 * Route Mappings
 * (sails.config.routes)
 *
 * Your routes map URLs to views and controllers.
 *
 * If Sails receives a URL that doesn't match any of the routes below,
 * it will check for matching files (images, scripts, stylesheets, etc.)
 * in your assets directory.  e.g. `http://localhost:1337/images/foo.jpg`
 * might match an image file: `/assets/images/foo.jpg`
 *
 * Finally, if those don't match either, the default 404 handler is triggered.
 * See `api/responses/notFound.js` to adjust your app's 404 logic.
 *
 * Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
 * flat files from `assets` to `.tmp/public`.  This allows you to do things like compile LESS or
 * CoffeeScript for the front-end.
 *
 * For more information on configuring custom routes, check out:
 * http://sailsjs.org/#!/documentation/concepts/Routes/RouteTargetSyntax.html
 */

module.exports.routes = {

  '/': 'HomeController.main',

  /***************************************************************************
   *                                                                          *
   * 登录操作.company and admin                                               *
   *                                                                          *
   ***************************************************************************/
  'get /login': 'LoginController.login',
  'post /login': 'LoginController.loginProcess',
  'get /logout': 'LoginController.logout',

  /***************************************************************************
   *                                                                          *
   * 通用路由,图片/文件上传等.
   *                                                                          *
   ***************************************************************************/
  'post /fileUpload/img': 'FileUploadController.uploadImg',
  'post /fileUpload/doc': 'FileUploadController.uploadFile',
  'post /fileUpload/xls': 'FileUploadController.uploadXls',

  'get /genImg/:size': 'FileUploadController.genImg',
  'get /img/:id': 'FileUploadController.img',
  'get /file/doc/:id': 'FileUploadController.downloadFile',

  /***************************************************************************
   *                                                                          *
   * route for admin                                                                *
   *                                                                          *
   ***************************************************************************/

  /***************************************************************************
   *                                                                          *
   * 企业端路由                                                               *
   *                                                                          *
   ***************************************************************************/

};
